
//var：变量声明

/*var donna = 0;
donna=7;
console.log(donna);

var a="hello donna";
console.log(a);

var c="你好 唐娜";
console.log(typeof c);

var b=true;
console.log(typeof b);*/


//页面输出

/*document.write(donna);

document.write("<br>");

document.write(a+c);

document.write("<h1>"+c+"</h1>");

document.write("<a class='' href='http://www.baidu.com'>"+a+"</a>");

document.write("<br>");

document.write("<input type='password'>");

document.write("<br>");*/




//逻辑运算符

/*
var La=true;
var Lb=false;

console.log(La && Lb);
console.log(La || Lb);
console.log(!La || Lb);
console.log(!La || Lb && La);
console.log(La && Lb && !Lb);
*/


/*
var time=19.36;

if(time >= 6 && time <9){
    console.log("Good morning");
}
else if(time >= 9 && time <18){
    console.log("Good day")
}
else if(time >= 18 && time <22){
    console.log("Good evening")
}
else{
    console.log("Good night")
}
*/


//循环语句

/*
var number_c=0;

while(number_c<=100){
    number_c++;
    if(number_c%2===0){
        console.log(number_c)
    }
}
*/

/*var num=0;

var numa=0;

while(num<=100){

    num++;

    if(num%3===0){numa+=num;
    }
};

console.log(numa);*/




//for循环

for(var z=0;z<=100;z++){
    if(z%2!==0){
        //console.log(z);
    }
}


//乘法表

for(var r = 1;r<10;r++){

    for(var u=1;u<=r;u++){
        /*console.log("r="+r);
        console.log("u="+u);
        console.log(r*u);*/


        var zhi =u + "x" + r + "="+r*u;
        document.write(zhi);
        document.write("&nbsp;&nbsp;&nbsp");
    }

    document.write("<br>");
}


//函数

//语法
function ceshi(x,y){
    return x*y;
}

//调用
var test =ceshi(8,5);
console.log(test);


//封装

















//jquery

//导航

function clicknav(){
    $ (this).addClass("on");
    $ (this).siblings().removeClass("on");
}

$("nav>a").click(clicknav);



//添加读取input的value值

/*function clickUser(){
    $(".username").val("用户名"); //传值
}
$(".btn").click(clickUser);*/



function clickUser(){
    var usn=$(".username").val();
    console.log(usn);
}
$(".btn").click(clickUser);



//弹窗

function showpop(){
    $(".mask,.pop").fadeIn("slow");
}

function hidepop(){
    $(".mask,.pop").fadeOut("slow");
}

$(".maskbtn").click(showpop);
$(".close").click(hidepop);


//改变

function no(){
    var changeBtn=$(this).text();

    if(changeBtn==="选择"){
        $(this).text('已选择');
    }
    else{
        $(this).text('选择');
    }
}
$('#change1').click(no);




//手风琴


//方法1
/*
function accordion(){
    $(this).next().slideToggle();
    $(this).parent().siblings().children('ul').slideUp();
}
*/

//方法2

function accordion(){
    $('.title_ul').slideUp();
    $(this).next().slideToggle();

}


$('.title').click(accordion);
















